<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <title></title>
    <link rel="stylesheet" href="${staticServer}/inc/style/main.css"/>
    <link rel="stylesheet" href="${staticServer}/inc/style/page.css"/>
    <link rel="stylesheet" href="${staticServer}/css/work_today.css"/>
    <link rel="stylesheet" href="${staticServer}/css/consultant_client_tracking.css"/>
    <link rel="stylesheet" href="${staticServer}/css/lanrenzhijia.css" />
     <link rel="stylesheet" href="${staticServer}/inc/style/date/datepicker.css"/>
    <script src="${staticServer}/inc/js/jquery.js"></script>
    <script src="${staticServer}/inc/js/pageset.js"></script>
    <script src="${staticServer}/inc/js/submitter.js"></script>
    <script src="${staticServer}/inc/js/tips.js"></script>
    
    <script src="${staticServer}/js/web/consultant_client_tracking_list.js?1.0"></script>

    <link rel="stylesheet" href="${staticServer}/inc/style/date/datepicker.css"/>
    <script src="${staticServer}/inc/js/datepicker.js"></script>
    
    <script>
        var contextPath = '${contextPath}';

        $(function () {
            $("#center").val("<#if center??>${center}</#if>");
            $("#goodsServiceType").val("<#if goodsServiceType??>${goodsServiceType}</#if>");
            $("#serviceType").val("<#if serviceType??>${serviceType}</#if>");
            $("#goods_state").val("<#if goods_state??>${goods_state}</#if>");
        });

        function submit() {
            var center = $("#center").val();
            var goodsServiceType = $("#goodsServiceType").val();
            var serviceType = $("#serviceType").val();
            var startTime = $("#startTime").val();
            var endTime = $("#endTime").val();
            var goods_state = $("#goods_state").val();
            window.location.href = "${contextPath}/goods/goodsServiceList.htm?center=" + center+ "&goodsServiceType=" + goodsServiceType+
            		"&serviceType=" + serviceType+ "&startTime=" + startTime+ "&endTime=" + endTime+ "&goods_state=" + goods_state;
        }
        function download() {
            var center = $("#center").val();
            var goodsServiceType = $("#goodsServiceType").val();
            var serviceType = $("#serviceType").val();
            var startTime = $("#startTime").val();
            var endTime = $("#endTime").val();
            var goods_state = $("#goods_state").val();
            $.post('${contextPath}/goods/toDownloadGoodsServiceList.json', {
                center: center,
                goodsServiceType: goodsServiceType,
                serviceType: serviceType,
                startTime: startTime,
                endTime: endTime,
                goods_state: goods_state
            }, function (data) {
                if (data) {
                    if (data.name != null) {
                        window.location.href = "http://120.55.241.58//mydata/uploadtea/xls/" + data.name;
                        //window.location.href = "G:/xuyafei/mydata/uploadoa/" + data.name;
                    }
                }
            });
        }


	$(function(){
	$("#serviceType").change(function(){
		var good_mnus = $("#serviceType").val();
	    $.post("${contextPath}/goods/goodsMnus.json", {
	    	"good_mnus" : good_mnus
		}, function(ms) {
	    	var list = ms.list;
	    	var objHtml="";
	    	$("#student").val("");
	    	for(var i=0;i<list.length;i++){
	    		objHtml +='<option value="'+list[i].id+'">'+list[i].name+'</option>';
	    	}
	    	$("#pratin").html(objHtml);
	    });

	})
});
	function seeAppraisalGoods(id){
    	$("#appraisalId").val(id);
    	$.post("${contextPath}/goods/toSeeGoodsService.json",
    			{"id":id}, 
   			function(ms) {
   				var goodsService=ms.goodsService;
   				$("#purchasePerson1").val(goodsService.purchasePerson);
   				$("#purchaseGoods1").val(goodsService.purchaseGoods);
   				$("#purchaseMessage1").val(goodsService.purchaseMessage);
   				
   				$('.theme-popover-mask').fadeIn(100);
   	           	$('.theme-popover').slideDown(200);
   	            $('.theme-poptit .close').click(function(){
   	            $('.theme-popover-mask').fadeOut(100);
   	                $('.theme-popover').slideUp(200);
   	            })
       	});
    }

    </script>
</head>

<body>
<input type="hidden" id="traId" value="">
<div id="home_link">
    <ul>
        <li></li>
        <li>&gt;</li>
        <li>采购管理</li>
        <li>&gt;</li>
        <li class="current">物品维修</li>
    </ul>
</div>
<div id="container">
    <div id="title">物品维修</div>
    <table class="simple_table" rel="nohover" style="min-width: 750px;">
        <tr>
            <td>
                <label for="phone">中心地址：</label>
                <select id="center">
                    <option value="">全部</option>
                <#if teacherslist??>
                    <#list teacherslist as list>
                        <option value="${list.name}">${list.name}</option>
                    </#list>
                </#if>
            </td>
            <td>
            	<label>物品类型：</label>
                <select id="goodsServiceType">
                    <option value="">请选择</option>
                    <option value="1">工程维修</option>
                    <option value="2">网络维修</option>
                    <option value="3">其他</option>
                </select>
                 <select id="serviceType">
                    <option value="">请选择</option>
                    <option value="1">建筑</option>
                    <option value="2">家具及其他硬件</option>
                    <option value="3">电器</option>
                    <option value="4">卫生间</option>
                    <option value="5">数码产品</option>
                    <option value="6">其他</option>
                </select>
            </td> 
            <td>
            	<label for="phone">开始时间：</label>
                <input type="text" id="startTime" rel="DATE::Y-m-d" value="${startTime}" size="15" maxlength="15"
                       readonly="readonly" class="DatePicker_Icon">
                <label for="phone">结束时间：</label>
                <input type="text" id="endTime" rel="DATE::Y-m-d" value="${endTime}" size="15" maxlength="15"
	                       readonly="readonly" class="DatePicker_Icon">
	            <label class="zt_widthlabel">审核状态：</label>
	            <#if webutil.getCookieUser().departments=="行政教务部">
					<select id="goods_state">
	                    <option value="">全部</option>
	                    <option value="1">未处理</option>
	                    <option value="2">审核通过</option>
	                    <option value="3">处理中</option>
	                    <option value="4">已完成</option>
	                </select>
	            <#else>
					<select id="goods_state">
	                    <option value="">全部</option>
	                    <option value="2">审核通过</option>
	                    <option value="3">处理中</option>
	                    <option value="4">已完成</option>
	                </select>
                </#if>
                <input type="button" value=" 查 询 " onclick="submit()"/>
                <#if webutil.getCookieUser().departments=="行政教务部">
                	<input type="button" value=" 下载" onclick="download()"/>
                </#if>
            </td>
             
        </tr>
    </table>


    <table>

		 <tr class="fields">
            <th width="8%">中心</th>
            <th width="8%">申请人</th>
            <th width="8%">行政老师</th>
            <th width="8%">维修老师</th>
            <th width="10%">维修类型</th>
            <th width="8%">维修分类</th>
            <th width="6%">维修子分类</th>
            <th width="8%">状态</th>
            <th width="8%">申请时间</th>
            <th width="8%">维修时间</th>
            <th width="10%">备注</th>
            <th width="8%">操作</th>
        </tr>
    	<#if goodsServicesList??>
        <#list goodsServicesList as list>
            <tr class="even_row" bgcolor="#f8f8f8">
                <td align="center">${list.center}</td>
                <td align="center">${list.username}</td>
                <td align="center">${list.auditname}</td>
                <td align="center">${list.servicename}</td>
                <td align="center">
                	<#if list.goodsServiceType=="1">
                   			      工程维修
                    <#elseif list.goodsServiceType=="2">
                      		    网络维修
                    </#if>
                </td>
                <td align="center">
                	<#if list.serviceType=="1">
                   			      建筑
                    <#elseif list.serviceType=="2">
                      		   家具及其他硬件
                    <#elseif list.serviceType=="3">
                      		   电器
                    <#elseif list.serviceType=="4">
                      		   卫生间
                    <#elseif list.serviceType=="5">
                      		   数码产品
                    </#if>
                </td>
                <td align="center">${list.serviceDetailName}</td>
                <td align="center">
                	<#if list.goods_state=="1">
                   			    未处理
                    <#elseif list.goods_state=="2">
                      		   审核通过
                    <#elseif list.goods_state=="3">
                      		   处理中
                    <#elseif list.goods_state=="4">
                      		   已完成
                    </#if>
                
                </td>
                <td align="center">${list.create_time}</td>
                <td align="center">${list.service_time}</td>
                <td align="center">
                    <a title="${list.msg}">
                        <em class="caption"></em>
                        <#if list.msg?length gt 9>${list.msg?substring(0,9)}...<#else>${list.msg}</#if>
                    </a>
                </td>
                <td align="center">
	                <#if  webutil.getCookieUser().departments=="行政教务部"&&(list.goods_state=="1"||list.goods_state=="2")>
	                	<a href="${contextPath}/goods/toGoodsServiceCheck.htm?id=${list.id}">审核</a>
	                <#elseif webutil.getCookieUser().departments=="行政教务部"&&(list.goods_state=="3"||list.goods_state=="4")>
				    	<a href="${contextPath}/goods/toGoodsServiceCheck.htm?id=${list.id}&flag=see">查看</a>
				    	<#if list.purchasePerson??>
	                		--<a href="#" onclick="seeAppraisalGoods(${list.id})">查看评价</a>
	                	</#if>
	                <#elseif webutil.getCookieUser().departments!="行政教务部"&&(list.goods_state!="1")>
	                	<#if list.purchasePerson??>
					    	<a href="${contextPath}/goods/toGoodsServiceCheck.htm?id=${list.id}&flag=see">查看</a>
	                		--<a href="#" onclick="seeAppraisalGoods(${list.id})">查看评价</a>
	                	<#else>
		                	<a href="${contextPath}/goods/toGoodsServiceCheck.htm?id=${list.id}">审核</a>
	                	</#if>
                	</#if>
                </td>
            </tr>
        </#list>
    </#if>

    </table>
</div>
<div class="emptyline"></div>
<div class="theme-popover">
    <div class="theme-poptit">
        <a href="javascript:;" title="关闭" class="close">X</a>
        <h3>物品采购评价</h3>
    </div>
    <div class="theme-popbod dform">
        <form class="theme-signin" >
          <ol>
                <li><strong>采购效率评价：</strong>
                    <select id="purchasePerson1" disabled>
	            		<option value="">请选择评分:</option>
	            		<option value="1">1分</option>
	            		<option value="2">2分</option>
	            		<option value="3">3分</option>
	            		<option value="4">4分</option>
	            		<option value="5">5分</option>
	            	</select><br/><br/>

                <li><strong>采购物品评价 ：</strong>
                	<select id="purchaseGoods1" disabled>
					<option value="">请选择评分:</option>
	            		<option value="1">1分</option>
	            		<option value="2">2分</option>
	            		<option value="3">3分</option>
	            		<option value="4">4分</option>
	            		<option value="5">5分</option>
	            	<select id="center4"><br/><br/>
                <li>
                 <li><strong>&nbsp;发表评价：</strong>
                	<textarea  style="width:200px;height:100px;" type="text" id="purchaseMessage1" disabled/></textarea>
                <li>
            </ol>
        </form>
    </div>
</div>
<div class="theme-popover-mask"></div>
<div id="pager">
    <ul id="pagination" style="padding-left: 14px">
    <#if page??>
        <#if page.pagetotal?? && page.pagetotal!="0">
            <#assign pagetotal = page.pagetotal>
        <#else>
            <#assign pagetotal = 1>
        </#if>
        <#if page.currpage??>
            <#assign currpage = page.currpage>
        <#else>
            <#assign currpage = 1>
        </#if>
        <#if currpage==1 >
            <li class="previous-off">首页</li>
            <li class="previous-off">上一页</li>
        <#else>
            <li class="previous"><a href="${contextPath}/goods/goodsServiceList.htm?center=${center}&goodsServiceType=${goodsServiceType}&serviceType=${serviceType}&startTime=${startTime}&endTime=${endTime}&goods_state=${goods_state}&currPage=1">首页</a>
            </li>
            <li class="previous"><a
                    href="${contextPath}/goods/goodsServiceList.htm?center=${center}&goodsServiceType=${goodsServiceType}&serviceType=${serviceType}&startTime=${startTime}&endTime=${endTime}&goods_state=${goods_state}&currPage=${currpage-1}">上一页</a>
            </li>
        </#if>
        <input type="hidden" id="total" value="${page.pagetotal}"/>
        <#if pagetotal<=11>
            <#list 1..pagetotal as index_up>
                <#if currpage==index_up >
                    <li class="current">${index_up}</li>
                <#else>
                    <li>
                        <a href="${contextPath}/goods/goodsServiceList.htm?center=${center}&goodsServiceType=${goodsServiceType}&serviceType=${serviceType}&startTime=${startTime}&endTime=${endTime}&goods_state=${goods_state}&currPage=${index_up}">${index_up}</a>
                    </li>
                </#if>
            </#list>
        <#else>
            <#if currpage<=8 >
                <#list 1..9 as index_up>
                    <#if currpage==index_up >
                        <li class="current">${index_up}</li>
                    <#else>
                        <li>
                            <a href="${contextPath}/goods/goodsServiceList.htm?center=${center}&goodsServiceType=${goodsServiceType}&serviceType=${serviceType}&startTime=${startTime}&endTime=${endTime}&goods_state=${goods_state}&currPage=${index_up}">${index_up}</a>
                        </li>
                    </#if>
                </#list>
                <li>...</li>
                <li>
                    <a href="${contextPath}/goods/goodsServiceList.htm?center=${center}&goodsServiceType=${goodsServiceType}&serviceType=${serviceType}&startTime=${startTime}&endTime=${endTime}&goods_state=${goods_state}&currPage=${pagetotal}">${pagetotal}</a>
                </li>

            <#elseif (currpage>= 9 && currpage<pagetotal-7)  >
                <li><a href="${contextPath}/goods/goodsServiceList.htm?center=${center}&goodsServiceType=${goodsServiceType}&serviceType=${serviceType}&startTime=${startTime}&endTime=${endTime}&goods_state=${goods_state}&currPage=1">1</a></li>
                <li>...</li>
                <#list currpage-3..currpage+3 as index_up>
                    <#if currpage==index_up >
                        <li class="current">${index_up}</li>
                    <#else>
                        <li>
                            <a href="${contextPath}/goods/goodsServiceList.htm?center=${center}&goodsServiceType=${goodsServiceType}&serviceType=${serviceType}&startTime=${startTime}&endTime=${endTime}&goods_state=${goods_state}&currPage=${index_up}">${index_up}</a>
                        </li>
                    </#if>
                </#list>
                <li>...</li>
                <li>
                    <a href="${contextPath}/goods/goodsList.htm?goodsServiceList.htm?center=${center}&goodsServiceType=${goodsServiceType}&serviceType=${serviceType}&startTime=${startTime}&endTime=${endTime}&goods_state=${goods_state}}&currPage=${pagetotal}">${pagetotal}</a>
                </li>
            <#else>
                <li><a href="${contextPath}/goods/goodsServiceList.htm?center=${center}&goodsServiceType=${goodsServiceType}&serviceType=${serviceType}&startTime=${startTime}&endTime=${endTime}&goods_state=${goods_state}&currPage=1">1</a></li>
                <li>...</li>
                <#list pagetotal-8..pagetotal as index_up>
                    <#if currpage==index_up >
                        <li class="current">${index_up}</li>
                    <#else>
                        <li>
                            <a href="${contextPath}/goods/goodsServiceList.htm?center=${center}&goodsServiceType=${goodsServiceType}&serviceType=${serviceType}&startTime=${startTime}&endTime=${endTime}&goods_state=${goods_state}&currPage=${index_up}">${index_up}</a>
                        </li>
                    </#if>
                </#list>
            </#if>
        </#if>
        <#if currpage==pagetotal >
            <li class="previous-off">下一页</li>
            <li class="previous-off">尾页</li>
        <#else>
            <li class="previous"><a
                    href="${contextPath}/goods/goodsServiceList.htm?center=${center}&goodsServiceType=${goodsServiceType}&serviceType=${serviceType}&startTime=${startTime}&endTime=${endTime}&goods_state=${goods_state}&currPage=${currpage+1}">下一页</a>
            </li>
            <li class="previous"><a
                    href="${contextPath}/goods/goodsServiceList.htm?center=${center}&goodsServiceType=${goodsServiceType}&serviceType=${serviceType}&startTime=${startTime}&endTime=${endTime}&goods_state=${goods_state}&currPage=${page.pagetotal}">尾页</a>
            </li>
        </#if>
        <li class="previous"></li>
        <li class="pageinfo">共${page.total}条记录</li>
    </#if>
    </ul>
</div>

<div class="emptyline"></div>
</body>
</html>